# coding: utf-8

import os
import shutil

folder_THUCNews = r'data\THUCNews'
folder_raw = r"data\raw"
for category in os.listdir(folder_raw):
    print(category)
    folder_dest = os.path.join(folder_THUCNews, category)
    if not os.path.exists(folder_dest):
        os.makedirs(folder_dest)
    folder = os.path.join(folder_raw, category)
    files = os.listdir(folder)[:6500]
    print(len(files))
    for name in files:
        shutil.copy(os.path.join(folder, name), os.path.join(folder_dest, name))

